package com.hnchances.controller;

import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import com.hnchances.domain.entity.Grades;
import com.hnchances.domain.response.CodeEnum;
import com.hnchances.domain.response.PageResult;
import com.hnchances.domain.response.ResponseResult;
import com.hnchances.mapper.GradesMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "成绩管理")
@RestController
@RequestMapping("/grades")
public class GradesController {
    @Autowired
    private GradesMapper gradesMapper;

//    @GetMapping("/list")
//    @ApiOperation("列表查询")
//    public ResponseResult list(Integer page, Integer pageSize) {
//        PageHelper.startPage(page, pageSize);
//        //2.通过mapper查询
//        List<Grades> list = gradesMapper.findAll();
//        if (CollectionUtils.isEmpty(list)) {
//            return ResponseResult.error(CodeEnum.NO_DATA_NOW);
//        }
//        PageInfo<Grades> listPageInfo = new PageInfo<Grades>(list);
//        PageResult<Grades> pageResult = new PageResult<>(listPageInfo);
//        return ResponseResult.ok(pageResult);
//    }

}
